package au.com.evoCoach.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import au.com.evoCoach.domain.LtiTeamPlayer;
import au.com.evoCoach.domain.Team;
import au.com.evoCoach.enums.LtiStatus;

@Repository
public class LtiTeamPlayerDAO extends BaseDAO {

	public LtiTeamPlayerDAO() {
		super(LtiTeamPlayer.class);
	}
	
	public List<LtiTeamPlayer> getLtis(Team team) {
	 	String sql = "from LtiTeamPlayer where player.team = :team and ltiStatus = :ltiStatus";
       	Query query = getSession().createQuery(sql);
       	query.setParameter("team", team);
        query.setParameter("ltiStatus", LtiStatus.OPEN);
       	
       	return query.list();		
	}
	
}
